package router

import (
	"gin-demo/aop"
	"gin-demo/controller/console"
	"gin-demo/controller/operate"
	"gin-demo/controller/test"
	_ "gin-demo/docs"
	"github.com/gin-gonic/gin"
	swaggerfiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

// 全局的路由

func Router(engine *gin.Engine) {

	engine.Use(aop.GinBodyLogMiddleware)
	engine.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
	console.AddConsoleClusterRouter(engine)
	operate.AddOperateRouter(engine)
	test.AddTestRouter(engine)
}
